#ifndef USBMANAGEMENT_H
#define USBMANAGEMENT_H

#define MAX_USB_COUNT 8

#define UNCONNECT_USB_PNG_PATH ":new/prefix1/Resources/51miz-E513142-A209F202.png"
#define CONNECT_USB_PNG_PATH ":new/prefix1/Resources/51miz-E415034-59AC3787.png"
#define MAX_USB_SIZE 60

#include <QFile>
#include <QString>
#include <QStringList>
#include <QDebug>
#include "qthread.h"

struct sUSB{
    QString name;
    QString mount_name;
    QString serial;
    bool is_Use;
    bool is_Change;
};


class USBManagementThread : public QThread
{
    Q_OBJECT
    void run();
public:
    USBManagementThread(QObject* parent)
        :QThread(parent)
    {
        runCount = 0;
        for(int i = 0; i < MAX_USB_COUNT; i++){
            msUSB[i].is_Use = false;
            msUSB[i].name = "";
            msUSB[i].mount_name = "";
        }
    }
    void setRunCount(int i);
protected:
signals:
    void ChangeWindowSignal(sUSB *);
private:
    QString getSerial(QString name);
    int runCount;
    sUSB msUSB[MAX_USB_COUNT];
};

#endif // USBMANAGEMENT_H
